package com.gzhryc.net_marketing.supplier.erp.dao;

import com.gzhryc.jdbc.BaseDao;
import com.gzhryc.jdbc.Query;
import com.gzhryc.net_marketing.supplier.erp.dao.db.SupplierGoodsSpace;

import java.sql.SQLException;

public class SupplierGoodsSpaceDao extends BaseDao<SupplierGoodsSpace> {

    public SupplierGoodsSpaceDao(String jdbcKey) {
        super(jdbcKey);
    }

    public Long maxIdByGoodsId(Long goodsId) throws SQLException {
        String sql = "SELECT max(id) FROM erp_goods_space WHERE goods_id = ?";
        Query query = new Query(sql);
        query.getParams().setObject(goodsId);
        return this.jdbcHelper.getFirstField(query,Long.class);
    }
}
